package com.example.concurrent.SynchronousQueue;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.SynchronousQueue;

/**
 * Created by Administrator on 2017/2/10 0010.
 */
public class SynchronousQueueDemo {

    public static void main(String[] args) {
        try {
            BlockingQueue queue   = new SynchronousQueue();
            //String implements java.lang.Comparable
            //queue.put("Value");

             if(queue==null){
                queue.put("Value2");
                System.out.println(queue.take().toString());
            }else{
                System.out.println(queue.take().toString());
            }

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
